<?php
namespace app\admin\controller;
use think\Request;
use think\Loader;
use think\Controller;
use think\Db;
class Index extends Controller
{
    public function getType(){
        // 指定允许其他域名访问 
        header('Access-Control-Allow-Origin:*');  
        // 响应类型  
        header('Access-Control-Allow-Methods:POST');  
        header('Access-Control-Allow-Methods:GET');  
        // 响应头设置  
        header('Access-Control-Allow-Headers:x-requested-with,content-type');
        $requset = Request::instance();
        $typeKey = $requset->post('typeKey');
        $addcartype = model('Index')->cartype_list($typeKey);
        return json($addcartype);
    }
}
